var which = new Object;

function TheSaveMenu()
{
  if (Player.tentsave == true)
  {
  RenderMap();
 
  WindowStyle.drawWindow(8, 8, 300, 12);
  Font.drawText(10, 10, "Save to What Slot?");

  // execute the menu
  var SaveMenu = new Menu();
  SaveMenu.font         = Font;
  SaveMenu.window_style = WindowStyle;
  SaveMenu.arrow        = Arrow;
  SaveMenu.addItem("Slot 1: " + OpenFile("slot" + 1).read("Player Name" , "Empty") + " Lv: " + OpenFile("slot" + 1).read("Player Level", 0), SaveMenuSlot1);
  SaveMenu.addItem("Slot 2: " + OpenFile("slot" + 2).read("Player Name" , "Empty") + " Lv: " + OpenFile("slot" + 2).read("Player Level", 0), SaveMenuSlot2);
  SaveMenu.addItem("Slot 3: " + OpenFile("slot" + 3).read("Player Name" , "Empty") + " Lv: " + OpenFile("slot" + 3).read("Player Level", 0), SaveMenuSlot3);
  SaveMenu.addItem("Slot 4: " + OpenFile("slot" + 4).read("Player Name" , "Empty") + " Lv: " + OpenFile("slot" + 4).read("Player Level", 0), SaveMenuSlot4);
  SaveMenu.addItem("Cancel", GameMenu);
  SaveMenu.execute(8, 34, 300, 40);
  }
  else
  {
  Talk_Window("Can't save here!", "blank.png");
  GameMenu();
  }
}
function SaveMenuSlot1()
{
  which = 1; 
  Save();
}
function SaveMenuSlot2()
{
  which = 2; 
  Save();
}
function SaveMenuSlot3()
{
  which = 3; 
  Save();
}
function SaveMenuSlot4()
{
  which = 4; 
  Save();
}

function TheLoadMenu()
{
 
WindowStyle.drawWindow(8, 8, 300, 12);
GradientFont.drawText(10, 10, "Load From What Slot?");

var image = LoadImage("Untitled.png");
image.blit(0, 0);

// execute the menu
var LoadMenu = new Menu();
LoadMenu.font         = GradientFont;
LoadMenu.window_style = WindowStyle;
LoadMenu.arrow        = Arrow;
LoadMenu.addItem("Slot 1: " + OpenFile("slot" + 1).read("Player Name" , "Empty") + " Lv: " + OpenFile("slot" + 1).read("Player Level", 0), LoadMenuSlot1);
LoadMenu.addItem("Slot 2: " + OpenFile("slot" + 2).read("Player Name" , "Empty") + " Lv: " + OpenFile("slot" + 2).read("Player Level", 0), LoadMenuSlot2);
LoadMenu.addItem("Slot 3: " + OpenFile("slot" + 3).read("Player Name" , "Empty") + " Lv: " + OpenFile("slot" + 3).read("Player Level", 0), LoadMenuSlot3);
LoadMenu.addItem("Slot 4: " + OpenFile("slot" + 4).read("Player Name" , "Empty") + " Lv: " + OpenFile("slot" + 4).read("Player Level", 0), LoadMenuSlot4);
LoadMenu.addItem("Cancel", MainMenu);
LoadMenu.execute(8, 34, 300, 40);
}

function LoadMenuSlot1()
{
  which = 1; 
  Load();
}
function LoadMenuSlot2()
{
  which = 2; 
  Load();
}
function LoadMenuSlot3()
{
  which = 3; 
  Load();
}
function LoadMenuSlot4()
{
  which = 4; 
  Load();
}

function Save()
{
 var file;
 file = OpenFile("slot" + which); 

 file.write("Player Tile Temp" , Player.tiletemp);

 file.write("Chest 0" , Chest.Num0);
 file.write("Chest 1" , Chest.Num1);
 file.write("Chest 2" , Chest.Num2);
 file.write("Chest 3" , Chest.Num3);
 file.write("Chest 4" , Chest.Num4);
 file.write("Chest 5" , Chest.Num5);
 file.write("Chest 6" , Chest.Num6);
 file.write("Chest 7" , Chest.Num7);
 file.write("Chest 8" , Chest.Num8);
 file.write("Chest 9" , Chest.Num9);
 file.write("Chest 10" , Chest.Num10);
 file.write("Chest 11" , Chest.Num11);
 file.write("Chest 12" , Chest.Num12);
 file.write("Chest 13" , Chest.Num13);
 file.write("Chest 14" , Chest.Num14);
 file.write("Chest 15" , Chest.Num15);
 file.write("Chest 16" , Chest.Num16);

 file.write("Player Name" , Player.name);
 file.write("Player Hp" , Player.hp);
 file.write("Player Maxhp" , Player.maxhp);
 file.write("Player Mp" , Player.mp);
 file.write("Player Maxmp",  Player.maxmp);
 file.write("Player Level",  Player.level);
 file.write("Player Exp",  Player.exp);
 file.write("Player NextLevel", Player.nextlevel);
 file.write("Player Gp",  Player.gp);
 file.write("Player Class",  Player.chrclass);
 file.write("Player Port",  Player.port);
 file.write("Player Items Potion",  Player.items.potion);
 file.write("Player Items Hi-Potion",  Player.items.hipotion);
 file.write("Player Items Ether",  Player.items.ether);
 file.write("Player Items Full Potion",  Player.items.fullpotion); 
 file.write("Player Items TurboEther",  Player.items.turboether);
 file.write("Player Items Elixer",  Player.items.elixer);
 file.write("Player Items Tent",  Player.items.tent);
 file.write("Player Items Life",  Player.items.life);
 file.write("Player TentSave",  Player.tentsave);
 file.write("Player Weapon",  Player.equipwep);
 file.write("Player Armour",  Player.equiparmour);

 file.write("Player Dagger",  Playerweapons.Dagger);
 file.write("Player Dirk",  Playerweapons.Dirk);
 file.write("Player ShortSword",  Playerweapons.Short_Sword);
 file.write("Player Mithril Knife",  Playerweapons.MithrilKnife);
 file.write("Player Conqudor Knife",  Playerweapons.ConqudorKnife);

 file.write("Player LongSword",  Playerweapons.Long_Sword);
 file.write("Player Broad Sword",  Playerweapons.BroadSword);
 file.write("Player Regal Sword",  Playerweapons.RegalSword);
 file.write("Player Mithril Blade",  Playerweapons.MithrilBlade);
 file.write("Player Adamantine Blade",  Playerweapons.AdamantineBlade);
 file.write("Player Legend Sword",  Playerweapons.LegendSword);

 file.write("Player Wooden Staff",  Playerweapons.WoodenStaff);
 file.write("Player Battle Staff",  Playerweapons.BattleStaff);
 file.write("Player Metal Staff",  Playerweapons.MetalStaff);
 file.write("Player Mage Staff",  Playerweapons.MageStaff);

 file.write("Player LeatherArmour",  Playerweapons.Lh_Armour);
 file.write("Player StuddedLeatherArmour",  Playerweapons.StudLh_Armour);
 file.write("Player Iron Plate",  Playerweapons.IronPlate);
 file.write("Player Silver Vest",  Playerweapons.SilverVest);
 file.write("Player Silver Plate",  Playerweapons.SilverPlate);
 file.write("Player Steel Plate",  Playerweapons.SteelPlate);
 file.write("Player Bronze Vest",  Playerweapons.BronzeVest);
 file.write("Player Bronze Plate",  Playerweapons.BronzePlate);
 file.write("Player Mithril Vest",  Playerweapons.MithrilVest);
 file.write("Player Mithril Plate",  Playerweapons.MithrilPlate);
 file.write("Player Gold Plate",  Playerweapons.GoldPlate);
 file.write("Player Platinum Plate",  Playerweapons.PlatinumPlate);
 file.write("Player Adamantine Plate",  Playerweapons.AdamantinePlate);
 file.write("Player Ancient Plate",  Playerweapons.AncientPlate);
 file.write("Player Cloak",  Playerweapons.Cloak);
 file.write("Player Cotton Robe",  Playerweapons.CottonRobe);
 file.write("Player Silk Robe",  Playerweapons.SilkRobe);
 file.write("Player Demon Plate",  Playerweapons.DemonPlate);
 file.write("Player Anglic Plate",  Playerweapons.AnglicPlate);

 file.write("Player DPres",  Player.DPlate);
 file.write("Player APres",  Player.APlate);

 file.write("Player Weapontemp",  Playerweapons.temp);
 file.write("Player Weapontempcost",  Playerweapons.tempcost);
 file.write("Player Temp",  Player.temp);
 file.write("Player Weapon Effect",  Player.weaponeffect);
 file.write("Player Armour Effect",  Player.armoureffect);
 file.write("Player Mattack Effect", Player.mattackeffect);
 file.write("Player Str",  Player.str);
 file.write("Player Agi",  Player.agi);
 file.write("Player Mag",  Player.mag);
 file.write("Player Vit",  Player.vit);
 file.write("Player Luck",  Player.luck);
 file.write("Player Attack",  Player.attack);
 file.write("Player Defence",  Player.defence);
 file.write("Player Mattack",  Player.mattack);
 file.write("Player Evade",  Player.evade);
 file.write("Player Sprite",  Player.sprite);
 file.write("Player Direction",  GetPersonDirection("main character"));
 file.write("Player Engage",  Player.engage);
 file.write("Player Quest",  Player.quest);
 file.write("Player Day",  Player.day);
 file.write("Player wepthing", Player.weaponthing);
 
 file.write("Player BMagic Fire", Playerbmagic.fire);
 file.write("Player BMagic Ice", Playerbmagic.ice);
 file.write("Player BMagic Lit", Playerbmagic.lit);
 file.write("Player BMagic Earth", Playerbmagic.earth);
 file.write("Player BMagic Drain Hp", Playerbmagic.drainhp);
 file.write("Player BMagic Fire 2", Playerbmagic.fire2);
 file.write("Player BMagic Ice 2", Playerbmagic.ice2);
 file.write("Player BMagic Lit 2", Playerbmagic.lit2);
 file.write("Player BMagic Earth 2", Playerbmagic.earth2);
 file.write("Player BMagic Drain Mp", Playerbmagic.drainmp);
 file.write("Player BMagic Aero", Playerbmagic.aero);
 file.write("Player BMagic Water", Playerbmagic.water);
 file.write("Player BMagic Fire 3", Playerbmagic.fire3);
 file.write("Player BMagic Ice 3", Playerbmagic.ice3);
 file.write("Player BMagic Lit 3", Playerbmagic.lit3);
 file.write("Player BMagic Earth 3", Playerbmagic.earth3);
 file.write("Player BMagic Aera", Playerbmagic.aera);
 file.write("Player BMagic Tidel Wave", Playerbmagic.tidelwave);
 file.write("Player BMagic Metra", Playerbmagic.metra);
 file.write("Player BMagic Alpha", Playerbmagic.alpha);
 file.write("Player BMagic Omega", Playerbmagic.omega);

 file.write("Player WMagic Cure", Playerwmagic.cure);
 file.write("Player WMagic Peep", Playerwmagic.peep);
 file.write("Player WMagic Light", Playerwmagic.light);
 file.write("Player WMagic Sleep", Playerwmagic.sleep);
 file.write("Player WMagic Life", Playerwmagic.life1);
 file.write("Player WMagic Cure 2", Playerwmagic.cure2);
 file.write("Player WMagic Regain", Playerwmagic.regain);
 file.write("Player WMagic Power-Up", Playerwmagic.powerup);
 file.write("Player WMagic Defence-Up", Playerwmagic.defup);
 file.write("Player WMagic Haste", Playerwmagic.haste);
 file.write("Player WMagic Slow", Playerwmagic.slow);
 file.write("Player WMagic Stop", Playerwmagic.stop);
 file.write("Player WMagic Cure 3", Playerwmagic.cure3);
 file.write("Player WMagic Safe", Playerwmagic.safe);
 file.write("Player WMagic Life 2", Playerwmagic.life2);
 file.write("Player WMagic Mega-Cure", Playerwmagic.megacure);
 file.write("Player WMagic Curse", Playerwmagic.curse);
 file.write("Player WMagic Recover", Playerwmagic.recover);

 file.write("Player Custom Number", Player.customnumber);
 file.write("Player Custom Learn", Player.customlearn);
 file.write("Player Custom Learning", Player.customlearning);

 file.write("Player CMagic Diease", Player.cmagic.diease);
 file.write("Player CMagic Diease Pres", Player.cmagic.dieasepres);
 file.write("Player CMagic Plague", Player.cmagic.plague);
 file.write("Player CMagic Plague Pres", Player.cmagic.plaguepres);
 file.write("Player CMagic Flare", Player.cmagic.flare);
 file.write("Player CMagic Flare Pres", Player.cmagic.flarepres);
 file.write("Player CMagic Explode", Player.cmagic.explode);
 file.write("Player CMagic Explode Pres", Player.cmagic.explodepres);
 file.write("Player CMagic Explode2", Player.cmagic.explode2);
 file.write("Player CMagic Explode2 Pres", Player.cmagic.explode2pres);
 file.write("Player CMagic Telekinesis", Player.cmagic.telekinesis);
 file.write("Player CMagic Telekinesis Pres", Player.cmagic.telekinesispres);

 file.write("Player CMagic MpRegain", Player.cmagic.mpregain);
 file.write("Player CMagic MpRegain Pres", Player.cmagic.mpregainpres);
 file.write("Player CMagic Anglic Ray", Player.cmagic.anglicray);
 file.write("Player CMagic Anglic Ray Pres", Player.cmagic.anglicraypres);
 file.write("Player CMagic Multi-Up", Player.cmagic.multiup);
 file.write("Player CMagic Multi-Up Pres", Player.cmagic.multiuppres);
 file.write("Player CMagic Hold", Player.cmagic.hold);
 file.write("Player CMagic Hold Pres", Player.cmagic.holdpres);
 file.write("Player CMagic Encounter", Player.cmagic.encounter);
 file.write("Player CMagic Encounter Pres", Player.cmagic.encounterpres);

 file.write("Player Soldier Dash", Playersoldier.dash);
 file.write("Player Soldier Dual Combo", Playersoldier.dualcombo);
 file.write("Player Soldier Sword Drain", Playersoldier.sworddrain);
 file.write("Player Soldier Charge", Playersoldier.charge);
 file.write("Player Soldier Quad Slice", Playersoldier.quadslice);

 file.write("Player Bard War Song", Playerbard.warsong);
 file.write("Player Bard Intimidate", Playerbard.intimidate);
 file.write("Player Bard Animals", Playerbard.animals);
 file.write("Player Bard Resonance", Playerbard.resonance);

 file.write("Player Ranger Animals", Playerranger.animals);
 file.write("Player Ranger Heal", Playerranger.heal);
 file.write("Player Ranger Def-Up", Playerranger.defup);
 file.write("Player Ranger Power-Up", Playerranger.powerup);
 file.write("Player Ranger Evade-Up", Playerranger.evade);
 file.write("Player Ranger Heal 2", Playerranger.heal2);
 file.write("Player Ranger Heal 3", Playerranger.heal3);

 file.write("Player2 Pres" , Player2.pres);
 file.write("Player2 Name" , Player2.name);
 file.write("Player2 Hp" , Player2.hp);
 file.write("Player2 Maxhp" , Player2.maxhp);
 file.write("Player2 Mp" , Player2.mp);
 file.write("Player2 Maxmp",  Player2.maxmp);
 file.write("Player2 Level",  Player2.level);
 file.write("Player2 Exp",  Player2.exp);
 file.write("Player2 NextLevel", Player2.nextlevel);
 file.write("Player2 Class",  Player2.chrclass);
 file.write("Player2 Port",  Player2.port);
 file.write("Player2 Weapon",  Player2.equipwep);
 file.write("Player2 Armour",  Player2.equiparmour);
 file.write("Player2 Weapon Effect",  Player2.weaponeffect);
 file.write("Player2 Armour Effect",  Player2.armoureffect);
 file.write("Player2 Mattack Effect", Player2.mattackeffect);
 file.write("Player2 Str",  Player2.str);
 file.write("Player2 Agi",  Player2.agi);
 file.write("Player2 Mag",  Player2.mag);
 file.write("Player2 Vit",  Player2.vit);
 file.write("Player2 Luck",  Player2.luck);
 file.write("Player2 Attack",  Player2.attack);
 file.write("Player2 Defence",  Player2.defence);
 file.write("Player2 Mattack",  Player2.mattack);
 file.write("Player2 Evade",  Player2.evade);
 file.write("Player2 Sprite",  Player2.sprite);
 file.write("Player2 wepthing", Player2.weaponthing);

 file.write("Player2 DPres",  Player2.DPlate);
 file.write("Player2 APres",  Player2.APlate);

 file.write("Player2 BMagic Fire", Player2bmagic.fire);
 file.write("Player2 BMagic Ice", Player2bmagic.ice);
 file.write("Player2 BMagic Lit", Player2bmagic.lit);
 file.write("Player2 BMagic Earth", Player2bmagic.earth);
 file.write("Player2 BMagic Drain Hp", Player2bmagic.drainhp);
 file.write("Player2 BMagic Fire 2", Player2bmagic.fire2);
 file.write("Player2 BMagic Ice 2", Player2bmagic.ice2);
 file.write("Player2 BMagic Lit 2", Player2bmagic.lit2);
 file.write("Player2 BMagic Earth 2", Player2bmagic.earth2);
 file.write("Player2 BMagic Drain Mp", Player2bmagic.drainmp);
 file.write("Player2 BMagic Aero", Player2bmagic.aero);
 file.write("Player2 BMagic Water", Player2bmagic.water);
 file.write("Player2 BMagic Fire 3", Player2bmagic.fire3);
 file.write("Player2 BMagic Ice 3", Player2bmagic.ice3);
 file.write("Player2 BMagic Lit 3", Player2bmagic.lit3);
 file.write("Player2 BMagic Earth 3", Player2bmagic.earth3);
 file.write("Player2 BMagic Aera", Player2bmagic.aera);
 file.write("Player2 BMagic Tidel Wave", Player2bmagic.tidelwave);
 file.write("Player2 BMagic Metra", Player2bmagic.metra);
 file.write("Player2 BMagic Alpha", Player2bmagic.alpha);
 file.write("Player2 BMagic Omega", Player2bmagic.omega);

 file.write("Player2 WMagic Cure", Player2wmagic.cure);
 file.write("Player2 WMagic Peep", Player2wmagic.peep);
 file.write("Player2 WMagic Light", Player2wmagic.light);
 file.write("Player2 WMagic Sleep", Player2wmagic.sleep);
 file.write("Player2 WMagic Life", Player2wmagic.life1);
 file.write("Player2 WMagic Cure 2", Player2wmagic.cure2);
 file.write("Player2 WMagic Regain", Player2wmagic.regain);
 file.write("Player2 WMagic Power-Up", Player2wmagic.powerup);
 file.write("Player2 WMagic Defence-Up", Player2wmagic.defup);
 file.write("Player2 WMagic Haste", Player2wmagic.haste);
 file.write("Player2 WMagic Slow", Player2wmagic.slow);
 file.write("Player2 WMagic Stop", Player2wmagic.stop);
 file.write("Player2 WMagic Cure 3", Player2wmagic.cure3);
 file.write("Player2 WMagic Safe", Player2wmagic.safe);
 file.write("Player2 WMagic Life 2", Player2wmagic.life2);
 file.write("Player2 WMagic Mega-Cure", Player2wmagic.megacure);
 file.write("Player2 WMagic Curse", Player2wmagic.curse);
 file.write("Player2 WMagic Recover", Player2wmagic.recover);

 file.write("Player2 Soldier Dash", Player2soldier.dash);
 file.write("Player2 Soldier Dual Combo", Player2soldier.dualcombo);
 file.write("Player2 Soldier Sword Drain", Player2soldier.sworddrain);
 file.write("Player2 Soldier Charge", Player2soldier.charge);
 file.write("Player2 Soldier Quad Slice", Player2soldier.quadslice);

 file.write("Player2 Bard War Song", Player2bard.warsong);
 file.write("Player2 Bard Intimidate", Player2bard.intimidate);
 file.write("Player2 Bard Animals", Player2bard.animals);
 file.write("Player2 Bard Resonance", Player2bard.resonance);

 file.write("Player2 Ranger Animals", Player2ranger.animals);
 file.write("Player2 Ranger Heal", Player2ranger.heal);
 file.write("Player2 Ranger Def-Up", Player2ranger.defup);
 file.write("Player2 Ranger Power-Up", Player2ranger.powerup);
 file.write("Player2 Ranger Evade-Up", Player2ranger.evade);
 file.write("Player2 Ranger Heal 2", Player2ranger.heal2);
 file.write("Player2 Ranger Heal 3", Player2ranger.heal3);


 file.write("Player3 Pres" , Player3.pres);
 file.write("Player3 Name" , Player3.name);
 file.write("Player3 Hp" , Player3.hp);
 file.write("Player3 Maxhp" , Player3.maxhp);
 file.write("Player3 Mp" , Player3.mp);
 file.write("Player3 Maxmp",  Player3.maxmp);
 file.write("Player3 Level",  Player3.level);
 file.write("Player3 Exp",  Player3.exp);
 file.write("Player3 NextLevel", Player3.nextlevel);
 file.write("Player3 Class",  Player3.chrclass);
 file.write("Player3 Port",  Player3.port);
 file.write("Player3 Weapon",  Player3.equipwep);
 file.write("Player3 Armour",  Player3.equiparmour);
 file.write("Player3 Weapon Effect",  Player3.weaponeffect);
 file.write("Player3 Armour Effect",  Player3.armoureffect);
 file.write("Player3 Mattack Effect", Player3.mattackeffect);
 file.write("Player3 Str",  Player3.str);
 file.write("Player3 Agi",  Player3.agi);
 file.write("Player3 Mag",  Player3.mag);
 file.write("Player3 Vit",  Player3.vit);
 file.write("Player3 Luck",  Player3.luck);
 file.write("Player3 Attack",  Player3.attack);
 file.write("Player3 Defence",  Player3.defence);
 file.write("Player3 Mattack",  Player3.mattack);
 file.write("Player3 Evade",  Player3.evade);
 file.write("Player3 Sprite",  Player3.sprite);
 file.write("Player3 wepthing", Player3.weaponthing);

 file.write("Player3 DPres",  Player3.DPlate);
 file.write("Player3 APres",  Player3.APlate);

 file.write("Player3 BMagic Fire", Player3bmagic.fire);
 file.write("Player3 BMagic Ice", Player3bmagic.ice);
 file.write("Player3 BMagic Lit", Player3bmagic.lit);
 file.write("Player3 BMagic Earth", Player3bmagic.earth);
 file.write("Player3 BMagic Drain Hp", Player3bmagic.drainhp);
 file.write("Player3 BMagic Fire 2", Player3bmagic.fire2);
 file.write("Player3 BMagic Ice 2", Player3bmagic.ice2);
 file.write("Player3 BMagic Lit 2", Player3bmagic.lit2);
 file.write("Player3 BMagic Earth 2", Player3bmagic.earth2);
 file.write("Player3 BMagic Drain Mp", Player3bmagic.drainmp);
 file.write("Player3 BMagic Aero", Player3bmagic.aero);
 file.write("Player3 BMagic Water", Player3bmagic.water);
 file.write("Player3 BMagic Fire 3", Player3bmagic.fire3);
 file.write("Player3 BMagic Ice 3", Player3bmagic.ice3);
 file.write("Player3 BMagic Lit 3", Player3bmagic.lit3);
 file.write("Player3 BMagic Earth 3", Player3bmagic.earth3);
 file.write("Player3 BMagic Aera", Player3bmagic.aera);
 file.write("Player3 BMagic Tidel Wave", Player3bmagic.tidelwave);
 file.write("Player3 BMagic Metra", Player3bmagic.metra);
 file.write("Player3 BMagic Alpha", Player3bmagic.alpha);
 file.write("Player3 BMagic Omega", Player3bmagic.omega);

 file.write("Player3 WMagic Cure", Player3wmagic.cure);
 file.write("Player3 WMagic Peep", Player3wmagic.peep);
 file.write("Player3 WMagic Light", Player3wmagic.light);
 file.write("Player3 WMagic Sleep", Player3wmagic.sleep);
 file.write("Player3 WMagic Life", Player3wmagic.life1);
 file.write("Player3 WMagic Cure 2", Player3wmagic.cure2);
 file.write("Player3 WMagic Regain", Player3wmagic.regain);
 file.write("Player3 WMagic Power-Up", Player3wmagic.powerup);
 file.write("Player3 WMagic Defence-Up", Player3wmagic.defup);
 file.write("Player3 WMagic Haste", Player3wmagic.haste);
 file.write("Player3 WMagic Slow", Player3wmagic.slow);
 file.write("Player3 WMagic Stop", Player3wmagic.stop);
 file.write("Player3 WMagic Cure 3", Player3wmagic.cure3);
 file.write("Player3 WMagic Safe", Player3wmagic.safe);
 file.write("Player3 WMagic Life 2", Player3wmagic.life2);
 file.write("Player3 WMagic Mega-Cure", Player3wmagic.megacure);
 file.write("Player3 WMagic Curse", Player3wmagic.curse);
 file.write("Player3 WMagic Recover", Player3wmagic.recover);

 file.write("Player3 Soldier Dash", Player3soldier.dash);
 file.write("Player3 Soldier Dual Combo", Player3soldier.dualcombo);
 file.write("Player3 Soldier Sword Drain", Player3soldier.sworddrain);
 file.write("Player3 Soldier Charge", Player3soldier.charge);
 file.write("Player3 Soldier Quad Slice", Player3soldier.quadslice);

 file.write("Player3 Bard War Song", Player3bard.warsong);
 file.write("Player3 Bard Intimidate", Player3bard.intimidate);
 file.write("Player3 Bard Animals", Player3bard.animals);
 file.write("Player3 Bard Resonance", Player3bard.resonance);

 file.write("Player3 Ranger Animals", Player3ranger.animals);
 file.write("Player3 Ranger Heal", Player3ranger.heal);
 file.write("Player3 Ranger Def-Up", Player3ranger.defup);
 file.write("Player3 Ranger Power-Up", Player3ranger.powerup);
 file.write("Player3 Ranger Evade-Up", Player3ranger.evade);
 file.write("Player3 Ranger Heal 2", Player3ranger.heal2);
 file.write("Player3 Ranger Heal 3", Player3ranger.heal3);

 for (i = 0; i < 3; i++)
 {
 file.write("PlaceD" + i, placeT[i]);
 }
 for (i = 0; i < 10; i++)
 {
 file.write("Phouse" + i, Phouse[i]);
 }
 
 if (Player.BugTempX >= 0)
 {
 file.write("Player BTX",  Player.BugTempX);
 file.write("Player BTY",  Player.BugTempY);
 }
//Events
 file.write("Player Event2",  Player.event2);
 file.write("Player Event3",  Player.event3);
 file.write("Player Event4",  Player.event4);
 file.write("Player Event5",  Player.event5);
 file.write("Player Event6",  Player.event6);
 file.write("Player Event7",  Player.event7);
 file.write("Player Event8",  Player.event8);
 file.write("Player Event9",  Player.event9);
 file.write("Player Event10",  Player.event10);
 file.write("Player Event11",  Player.event11);
 file.write("Player Event12",  Player.event12);
 file.write("Player Event13",  Player.event13);
 file.write("Player Event14",  Player.event14);
 file.write("Player Event15",  Player.event15);
 file.write("Player Event16",  Player.event16);
 file.write("Player Event17",  Player.event17);
 file.write("Player Event18",  Player.event18);

//Position
 file.write("Player Map", map);
 file.write("Player PosX", GetPersonX("main character"));
 file.write("Player PosY", GetPersonY("main character"));
 file.write("Player Layer", GetPersonLayer("main character"));
 file.write("Player Direction", GetPersonDirection("main character"));

 Talk_Window("Game Saved", "blank.png");
}

